package com.zgb.manager.api;

import com.zx.sso.core.login.SsoWebLoginHelper;
import com.zx.sso.core.user.ZxSsoUser;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * sso server (for web)
 *
 * @author xuxueli 2017-08-01 21:39:47
 */
@org.springframework.stereotype.Controller
public class Controller {

    @RequestMapping("/")
    public String index(Model model, HttpServletRequest request, HttpServletResponse response) {
        // login check
        ZxSsoUser xxlUser = SsoWebLoginHelper.loginCheck(request, response);
        model.addAttribute("xxlUser", xxlUser);
        return "index";
    }
}